package com.acc.test.service;

import com.acc.test.domain.TAge;
import com.acc.test.mapper.TAgeMapper;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.business.feign.mds.comTest.ComTestFeign;
import com.codingapi.txlcn.tc.annotation.LcnTransaction;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

/**
 * @author: mengxiangzhong
 * @date: 2023/11/15 17:42
 * @TODO:
 **/
@Service
public class TageServiceImpl extends ServiceImpl<TAgeMapper, TAge> implements TAgeService {

    @Resource
    private ComTestFeign testFeign;

    @Override
    @LcnTransaction
    @Transactional
    public Integer addOneAge(TAge age) {
        save(age);

        JSONObject obj = new JSONObject();
        obj.put("name","mmmm");
        testFeign.addTUser(JSON.toJSONString(obj));
        int i =1/0;
        return null;
    }
}
